#pragma once
#include <iostream>
#include <vector>
#include <string>
#include "Record.h"

class RowSet
{
private:
	std::vector<std::string> _columnName;
	std::vector<Record> _rowset;
	std::vector<Record>::iterator _cur, _next;
	int _rowsAffected;
public:
	RowSet(void);
	void Reset() { _next = _rowset.begin(); _cur = _next; }
	void AddRecord(Record r) { _rowset.push_back(r); }
	void AddColumnName(std::string colname) {this->_columnName.push_back(colname);}
	bool IsColumnNameEmpty();
	bool HasNext() { return _next != _rowset.end(); }
	bool Next();
	int GetInt(int col);
	std::string GetString(int col);
	std::string GetMsg();
	void PrintRowSet();
	int IncreaseAffected() { _rowsAffected ++; return _rowsAffected; }
	int GetRowsAffected() { return _rowsAffected; }
	~RowSet(void);
};
